/*

ConnectionManagerTest.run;
ConnectionManagerTest.integratedTestStep1;
ConnectionManagerTest.integratedTestStep2;
ConnectionManagerTest.testGui;
ConnectionManagerTest.isVoiceInMasterChainTest
ConnectionManagerTest.isParentAndChildTest
ConnectionManagerTest.getChildrenTest

*/

ConnectionManagerTest{

	*integratedTestStep1{
		Ripple.init	
	}
	
	*isParentAndChildTest{
	
		var cman;
		
		cman = ConnectionManager.new(this);
		
		cman.addConnection("v1", "v2", "Connection");
		cman.addConnection("v2", "v3", "Connection");
		
		cman.isParentAndChild("v1", "v2").postln;
	
	}
	
	*getChildrenTest{
	
		var cman;
		
		cman = ConnectionManager.new(this);
		
		cman.addConnection("v1", "v2", "Connection");
		cman.addConnection("v1", "v3", "Connection");
		
		cman.getChildren("v1").postln;
	}
	
	*integratedTestStep2{
		Ripple.launchSLFromPath(\rippleSampler, "sounds/1. presets emm/bones randomized");
		Ripple.launchSLFromPath(\rippleSampler, "sounds/1. presets emm/buzzes");
		
		Ripple.addConnection("bones randomized", "buzzes");
		
		Ripple.setControlValue("bones randomized", \volume, 1);
		Ripple.setControlValue("bones randomized", \volume2, 1);
		Ripple.setControlValue("bones randomized", \startOffset, 0.1);
		
		Ripple.setControlValue("buzzes", \volume, 1);
		Ripple.setControlValue("buzzes", \volume2, 1);
		Ripple.setControlValue("buzzes", \startOffset, 0.1);
		
	}
	
	*isVoiceInMasterChainTest{
		var cman;
		
		cman = ConnectionManager.new(this);
		
		cman.addConnection("v1", "v2", "Connection");
		cman.addConnection("v2", "v3", "Connection");
		
		cman.isVoiceInMasterChain("v3", "v1").postln;
		
	}

	*run{
		var cman;
		
		cman = ConnectionManager.new(this);
		
		cman.addConnection("sourceName", "targetName", "Connection");
		cman.addConnection("targetName", "targetName1", "Connection");
		
		cman.soundPlayed("sourceName");
		
	}
	
	*playSound{|targetName|
		"playing ".post;
		targetName.postln;	
	}

}